<extend name="Public:header" />
<form method="post" enctype="multipart/form-data" action="{:U('/Case',array('id'=>$cases['id']))}">
    <div class="panel one-box">
    	<div class="table-tools clearfix">
			<div class="form-inline">
				<div class="form-group">
					<div class="field">
						标题：<input type="text" class="input" size="30" name="title" value="{$s_title}">
					
					</div>
				</div>
				<div class="form-button">
					<input type="submit" name="search" class="button bg-blue button-small" value="查询">
				</div>
			</div>
		</div>
    	
        <div class="table-responsive">
            <table id="table" class="table table-hover ">
                <tbody>
                    <tr>
                        <th>编号</th>
                        <th>标题</th>						
						<th>所属类型</th>					
					
						<th>封面</th>
						<th>时间</th>
                        <th>操作</th>
                    </tr>
                    <foreach name="case" item="v">
                        <tr>
                            <td>{$v.id}</td>
                            <td>{$v.title}</td>
							<td>
							  <foreach name="v[type]" item="t">	
								{$t.name}
							 </foreach>
							</td>						
							<td>
							<?php if(!empty($v['image'])):?>
								<a href="__ROOT__/Uploads/{$v.image}" target="_blank"><span class="h5 tag bg-sub">查看</span></a>
							<?php endif;?>
							</td>
							<td>{$v.time|date='Y-m-d H:i',###}</td>
                            <td>                           
								<a class="button bg-blue button-small icon-pencil" title="修改" alt="修改" href="__ROOT__/admin.php/Case/edit/id/{$v['id']}"></a>
								<a class="button bg-red button-small icon-trash-o js-del" title="删除" alt="删除" target1="__ROOT__/admin.php/Case/delete/id/{$v['id']}" href="javascript:;"></a>
                            </td>
                        </tr>
                    </foreach>
                </tbody>
            </table>
        </div>
        <div class="panel-foot table-foot clearfix">
            <div class="float-right pagination pagination-small">
                {$pages}
            </div>
        </div>
    </div>
</form>
<script>
    $(function($) {
    	// 绑定删除操作
        $(".js-del").click(function () {
            var delUrl = $(this).attr('target1');
            //询问框
			layer.confirm('您确定删除吗?', {
				icon: 4,
			    btn: ['确定','取消'] //按钮
			}, function(){
				$.post(delUrl,$("form").serialize(),function(data){
	                layer.msg(data.info, {icon: 1});
	                setTimeout("window.location.reload()",1000); // 让提示框停留一会
	            });
			});
        });

    });
</script>
<extend name="Public:footer" />